#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setWindowTitle("标签小部件控件测试");
    this->setGeometry(300,200,600,400);
    tabWidgetUI=new QTabWidget(this);
    tabWidgetUI->setGeometry(20,20,560,360);
    tabWidgetUI->show();

    bool m_showtabwidgetui1=true;
    bool m_showtabwidgetui2=true;

    if(m_showtabwidgetui1)
    {
        QWidget *qwidget1=new QWidget();
        tabWidgetUI->addTab(qwidget,"进程");


        QLabel lab1=new QLabel("请选择文件及文件夹");
        QLineEdit ledit1=new QLineEdit();
        QPushButton *pbt1=new QPushButton("消息框...");
        connect(pbt1,SIGNAL(clicked(bool)),this,SLOT(MsgCommit()));

        QGridLayout *glayoutt=new QGridLayout;
        glayoutt->addWidget(lab1,0,0);
        glayoutt->addWidget(ledit1,0,1);
        glayoutt->addWidget(pbt1,0,2);

        qwidget1->setLayout(glayoutt);

    }


    if(m_showtabwidgetui2)
    {
        QWidget *qwidget2=new QWidget();
        tabWidgetUI->addTab(qwidget2,"性能");
    }




}

Widget::~Widget()
{
    delete ui;
}

void Widget::MsgCommit()
{
    QMessageBox::information(NULL,"testing","QMessageBox：命令按钮测试成功!",QMessageBox::Ok);
}

